package com.springboot.springboot2.Controller;

import org.springframework.web.bind.annotation.*;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.net.http.HttpResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName:
 * @author: CKC
 * @DateTime: 2021/1/28 14:15
 *
 * REST 风格 SpringMVC也讲过
 *
 */
@RestController
public class RESTController {
    
    @RequestMapping(value = "/user",method = RequestMethod.GET)
    public String getUser(HttpServletResponse httpServletResponse) {
        httpServletResponse.addCookie(new Cookie("_ga","123456"));
        return "GET-User";
    }
    
    @PostMapping("/user")
    public String SaveUser() {
        
        return "POST-User";
    }
    
    @PutMapping("/user")
    
    public String PutUser() {
        
        return "PUT-User";
    }
    
    @DeleteMapping("/user")
    public String DeleteUser() {
        
        return "Delete-User";
    }
    

    
}
